﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
namespace RPGGameLibrary
{
    class MapsManager:List<Map>
    {
        /*public static string LoadLua(string location)
        {
            StreamReader Reader = new StreamReader(location, Encoding.Default);
            string back="";
            string buffer;
            while ((buffer = Reader.ReadLine()) != null)
            {
                back+=buffer;
            }
            return back;
        }*/


        public MapsManager(Game Game)
        {
         
           // string DefaultScript= LoadLua("DefaultMap.lua");
           // this.Add(new Map(Game,DefaultScript));
            this.Add(new Map(Game));
        }

        public MapsManager(Game Game,string GameName)
        {

            // string DefaultScript= LoadLua("DefaultMap.lua");
            // this.Add(new Map(Game,DefaultScript));
            this.Add(new Map(Game,"FirstMap"));
        }


        public void Draw(GraphicsDeviceManager _gra)
        {
            foreach (Map Map in this)
            {
                Map.Draw( _gra);
            }
        }
        public void Start()
        {
            foreach (Map map in this)
            {
                map.Initialize();
            }
        }
        public void Update(GameTime gameTime)
        {
            foreach (Map map in this)
            {
                map.Update(gameTime);
            }
        }
    }
}
